| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Public Member Functions | List of all members
nkDebug::DefaultTestObserver Class Referencefinal

Default implementation of a test run observer. More...

Inheritance diagram for nkDebug::DefaultTestObserver:

## Public Member Functions
| DefaultTestObserver () noexcept
virtual | ~DefaultTestObserver ()
void | setLiveFormatter (OutputFormatter *formatter)
void | setFinalFormatter (OutputFormatter *formatter)
void | setLiveOutput (OutputTarget *target)
void | setFinalOutput (OutputTarget *target)
virtual void | onRunLaunch (const TestRunParameters &params) override
virtual void | onRunEnd () override
virtual void | onClassLaunch (const TestClassObserverInformation &info) override
virtual void | onClassBypass (const TestClassObserverInformation &info) override
virtual void | onClassEnd (const TestClassObserverInformation &info) override
virtual void | onTestLaunch (const TestFunctionObserverInformation &info) override
virtual void | onTestBypass (const TestFunctionObserverInformation &info) override
virtual void | onTestSuccess (const TestFunctionObserverInformation &info) override
virtual void | onTestFailure (const TestFunctionObserverInformation &info) override
Public Member Functions inherited from nkDebug::TestObserver
| TestObserver () noexcept
virtual | ~TestObserver ()

## Detailed Description

Default implementation of a test run observer.

This default implementation is directly calling a formatter when called.
By default, it is coupled with a ConsoleOutputFormatter and the output target set to use the LogManager for live logging. Final logging is disabled.

## Constructor & Destructor Documentation

## ◆ DefaultTestObserver()

nkDebug::DefaultTestObserver::DefaultTestObserver | ( |  | ) |
| noexcept

Default constructor.

## ◆ ~DefaultTestObserver()

virtual nkDebug::DefaultTestObserver::~DefaultTestObserver | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ setLiveFormatter()

void nkDebug::DefaultTestObserver::setLiveFormatter | ( | OutputFormatter * | formatter | ) |

Sets the formatter to route the logging to. This method concerns live logging, logged right when it happens.

Parameters

  formatter | The formatter to use.

Remarks
  This defaults to a ConsoleOutputFormatter.

## ◆ setFinalFormatter()

void nkDebug::DefaultTestObserver::setFinalFormatter | ( | OutputFormatter * | formatter | ) |

Sets the formatter to route the logging to. This method concerns the final logging, that gets cached and logged at once in the end.

Parameters

  formatter | The formatter to use.

Remarks
  This defaults to a ConsoleOutputFormatter.

## ◆ setLiveOutput()

void nkDebug::DefaultTestObserver::setLiveOutput | ( | OutputTarget * | target | ) |

Sets the output to route the logging to. This method concerns live logging, logged right when it happens.

Parameters

  target | The target to use.

Remarks
  This defaults to a target using the LogManager.

## ◆ setFinalOutput()

void nkDebug::DefaultTestObserver::setFinalOutput | ( | OutputTarget * | target | ) |

Sets the output to route the logging to. This method concerns live logging, logged right when it happens.

Parameters

  target | The target to use. Set to nullptr to prevent it from logging at the end of the run.

Remarks
  This defaults to a nullptr target, preventing logging from happening.

## ◆ onRunLaunch()

virtual void nkDebug::DefaultTestObserver::onRunLaunch | ( | const TestRunParameters & | params | ) |
| override virtual

Called when a run is about to start.

Parameters

  params | The test parameters passed for the run.

Reimplemented from nkDebug::TestObserver.

## ◆ onRunEnd()

virtual void nkDebug::DefaultTestObserver::onRunEnd | ( |  | ) |
| override virtual

Called when a run is fully done.

Reimplemented from nkDebug::TestObserver.

## ◆ onClassLaunch()

virtual void nkDebug::DefaultTestObserver::onClassLaunch | ( | const TestClassObserverInformation & | info | ) |
| override virtual

Called when a TestClass is being started for a test run.

Parameters

  info | Current information about the run.

Reimplemented from nkDebug::TestObserver.

## ◆ onClassBypass()

virtual void nkDebug::DefaultTestObserver::onClassBypass | ( | const TestClassObserverInformation & | info | ) |
| override virtual

Called when a TestClass is being bypassed.

Parameters

  info | Current information about the run.

Reimplemented from nkDebug::TestObserver.

## ◆ onClassEnd()

virtual void nkDebug::DefaultTestObserver::onClassEnd | ( | const TestClassObserverInformation & | info | ) |
| override virtual

Called when a TestClass has finished running.

Parameters

  info | Current information about the run.

Reimplemented from nkDebug::TestObserver.

## ◆ onTestLaunch()

virtual void nkDebug::DefaultTestObserver::onTestLaunch | ( | const TestFunctionObserverInformation & | info | ) |
| override virtual

Called when a TestClass' test function is being launched.

Parameters

  info | Current information about the run.

Reimplemented from nkDebug::TestObserver.

## ◆ onTestBypass()

virtual void nkDebug::DefaultTestObserver::onTestBypass | ( | const TestFunctionObserverInformation & | info | ) |
| override virtual

Called when a TestClass's function is bypassed.

Parameters

  info | Current information about the run.

Reimplemented from nkDebug::TestObserver.

## ◆ onTestSuccess()

virtual void nkDebug::DefaultTestObserver::onTestSuccess | ( | const TestFunctionObserverInformation & | info | ) |
| override virtual

Called when a TestClass' test function succeeds.

Parameters

  info | Current information about the run.

Reimplemented from nkDebug::TestObserver.

## ◆ onTestFailure()

virtual void nkDebug::DefaultTestObserver::onTestFailure | ( | const TestFunctionObserverInformation & | info | ) |
| override virtual

Called when a TestClass' test function fails.

Parameters

  info | Current information about the run.

Reimplemented from nkDebug::TestObserver.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsDebug/Testing/Observers/DefaultTestObserver.h